﻿// -----------------------------------------------------------------------
// <copyright file="ISystemIoConverter.cs" company="Company">
// Company 2011
// </copyright>
// -----------------------------------------------------------------------

using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using Company.IO.Interfaces;
using FileAccess = System.IO.FileAccess;
using FileAttributes = Company.IO.Interfaces.FileAttributes;
using FileMode = System.IO.FileMode;
using FileOptions = System.IO.FileOptions;
using FileShare = System.IO.FileShare;
using SearchOption = System.IO.SearchOption;
using SeekOrigin = System.IO.SeekOrigin;

namespace Company.System.IO
{
    /// <summary>
    /// Converter to convert between the used Types
    /// </summary>
    [Guid("1037d388-9784-46e8-a894-a38f30e82c8f")]
    public interface ISystemIoConverter
    {
        /// <summary>
        /// Convert a DirectoryInfo object to <see cref="IDirectoryInfo"/> object
        /// </summary>
        /// <param name="directoryInfo">The given object to convert</param>
        /// <returns>The converted object</returns>
        IDirectoryInfo Convert(global::System.IO.DirectoryInfo directoryInfo);

        /// <summary>
        /// Convert a DirectoryInfo[] object to <see cref="IDirectoryInfo"/>[] object
        /// </summary>
        /// <param name="directoryInfos">The given object to convert</param>
        /// <returns>The converted object</returns>
        IDirectoryInfo[] Convert(global::System.IO.DirectoryInfo[] directoryInfos);

        /// <summary>
        /// Convert a IEnumerable DirectoryInfo object to IEnumerable <see cref="IDirectoryInfo"/> object
        /// </summary>
        /// <param name="directoryInfos">The given object to convert</param>
        /// <returns>The converted object</returns>
        IEnumerable<IDirectoryInfo> Convert(IEnumerable<global::System.IO.DirectoryInfo> directoryInfos);

        /// <summary>
        /// Convert a FileInfo object to <see cref="IFileInfo"/> object
        /// </summary>
        /// <param name="fileInfo">The given object to convert</param>
        /// <returns>The converted object</returns>
        IFileInfo Convert(global::System.IO.FileInfo fileInfo);

        /// <summary>
        /// Convert a FileInfo[] object to <see cref="IFileInfo"/>[] object
        /// </summary>
        /// <param name="fileInfos">The given object to convert</param>
        /// <returns>The converted object</returns>
        IFileInfo[] Convert(global::System.IO.FileInfo[] fileInfos);

        /// <summary>
        /// Convert a IEnumerable FileInfo object to IEnumerable <see cref="IFileInfo"/> object
        /// </summary>
        /// <param name="fileInfo">The given object to convert</param>
        /// <returns>The converted object</returns>
        IEnumerable<IFileInfo> Convert(IEnumerable<global::System.IO.FileInfo> fileInfo);

        /// <summary>
        /// Convert a FileSystemInfo object to <see cref="IFileSystemInfo"/> object
        /// </summary>
        /// <param name="fileSystemInfo">The given object to convert</param>
        /// <returns>The converted object</returns>
        IFileSystemInfo Convert(FileSystemInfo fileSystemInfo);

        /// <summary>
        /// Convert a FileSystemInfo[] object to <see cref="IFileSystemInfo"/>[] object
        /// </summary>
        /// <param name="fileSystemInfos">The given object to convert</param>
        /// <returns>The converted object</returns>
        IFileSystemInfo[] Convert(FileSystemInfo[] fileSystemInfos);

        /// <summary>
        /// Convert a IEnumerable FileSystemInfo object to IEnumerable <see cref="IFileSystemInfo"/> object
        /// </summary>
        /// <param name="fileSystemInfo">The given object to convert</param>
        /// <returns>The converted object</returns>
        IEnumerable<IFileSystemInfo> Convert(IEnumerable<FileSystemInfo> fileSystemInfo);

        /// <summary>
        /// Convert a FileAttributes object to <see cref="FileAttributes"/> object
        /// </summary>
        /// <param name="fileAttributes">The given object to convert</param>
        /// <returns>The converted object</returns>
        FileAttributes Convert(global::System.IO.FileAttributes fileAttributes);

        /// <summary>
        /// Convert a <see cref="FileAttributes"/> object to FileAttributes object
        /// </summary>
        /// <param name="fileAttributes">The given object to convert</param>
        /// <returns>The converted object</returns>
        global::System.IO.FileAttributes Convert(FileAttributes fileAttributes);

        /// <summary>
        /// Convert a SearchOption object to <see cref="Company.IO.Interfaces.SearchOption"/> object
        /// </summary>
        /// <param name="searchOption">The given object to convert</param>
        /// <returns>The converted object</returns>
        SearchOption Convert(Company.IO.Interfaces.SearchOption searchOption);

        /// <summary>
        /// Convert a FileShare object to <see cref="Company.IO.Interfaces.FileShare"/> object
        /// </summary>
        /// <param name="share">The given object to convert</param>
        /// <returns>
        /// The converted object
        /// </returns>
        FileShare Convert(Company.IO.Interfaces.FileShare share);

        /// <summary>
        /// Convert a FileAccess object to <see cref="Company.IO.Interfaces.FileAccess"/> object
        /// </summary>
        /// <param name="access">The given object to convert</param>
        /// <returns>
        /// The converted object
        /// </returns>
        FileAccess Convert(Company.IO.Interfaces.FileAccess access);

        /// <summary>
        /// Convert a FileMode object to <see cref="Company.IO.Interfaces.FileMode"/> object
        /// </summary>
        /// <param name="mode">The given object to convert</param>
        /// <returns>
        /// The converted object
        /// </returns>
        FileMode Convert(Company.IO.Interfaces.FileMode mode);

        /// <summary>
        /// Convert a Stream object to <see cref="IStream"/> object
        /// </summary>
        /// <param name="stream">The given object to convert</param>
        /// <returns>The converted object</returns>
        IStream Convert(global::System.IO.Stream stream);

        /// <summary>
        /// Convert a StreamReader object to <see cref="IStreamReader"/> object
        /// </summary>
        /// <param name="streamReader">The given object to convert</param>
        /// <returns>The converted object</returns>
        IStreamReader Convert(global::System.IO.StreamReader streamReader);

        /// <summary>
        /// Convert a StreamWriter object to <see cref="IStreamWriter"/> object
        /// </summary>
        /// <param name="streamWriter">The given object to convert</param>
        /// <returns>The converted object</returns>
        IStreamWriter Convert(global::System.IO.StreamWriter streamWriter);

        /// <summary>
        /// Converts the specified origin.
        /// </summary>
        /// <param name="origin">The origin.</param>
        /// <returns>the converted object</returns>
        SeekOrigin Convert(Company.IO.Interfaces.SeekOrigin origin);

        /// <summary>
        /// Converts the specified options.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <returns>The converted object</returns>
        FileOptions Convert(Company.IO.Interfaces.FileOptions options);

        /// <summary>
        /// Converts the specified exception.
        /// </summary>
        /// <param name="exception">The exception.</param>
        /// <returns>The converted object</returns>
        IException Convert(global::System.Exception exception);
    }
}